package com.zts.base.entity;

import org.springframework.hateoas.Identifiable;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by Zhangkh on 2017/5/31.
 */
public abstract class EntityModel<T> implements Identifiable<Long>, Serializable {

    private static final long serialVersionUID = 1L;

    protected Long id; //实体id
    protected String remark;    // 备注
//    protected Date createTime;// 创建日期
//    protected Date updateTime;    // 更新日期

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    @Override
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    /**
     * 通过一个model对象生成一个对应的实体对象
     */
    public abstract T transEntity();

    public abstract T transEntity(T entity);

}
